package com.ctgu.module.admin.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.ctgu.module.admin.mapper.MailboxMapper;
import com.ctgu.module.admin.model.Mailbox;
import com.ctgu.module.admin.service.MailboxService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;


@Service
@AllArgsConstructor
public class MailboxServiceImpl extends ServiceImpl<MailboxMapper, Mailbox> implements MailboxService {

    MailboxMapper mailboxMapper;

    @Override
    public int updateMailBoxConfig(Mailbox mailbox) {
        //提取邮件中的
        QueryWrapper<Mailbox> wrapper = new QueryWrapper<>();
        wrapper.eq("user_id",mailbox.getUserId());
        return mailboxMapper.update(mailbox, wrapper);
    }

    @Override
    public boolean updateMailBoxConfigByUserID(Integer userID) {
//        QueryWrapper<Mailbox> wrapper = new QueryWrapper<>();
//        wrapper.eq("user_id",userID);
//        return mailboxMapper.update(wrapper);
        return false;
    }

}
